<template>
	<view>
		<view class="fx-center-between setup-item setup-box" @click="toAccount">
			<view class="">账户与安全</view>
			<van-icon name="arrow" color="#8A8F99" />
		</view>
		<view class="setup-box">
			<view class="fx-center-between setup-item" @click="toArtical('agreement')">
				<view class="">用户服务协议</view>
				<van-icon name="arrow" color="#8A8F99" />
			</view>
			<view class="fx-center-between setup-item" @click="toArtical('privacy')">
				<view class="">隐私政策</view>
				<van-icon name="arrow" color="#8A8F99" />
			</view>
			<!-- <view class="fx-center-between setup-item" @click="toArtical('info_list')">
				<view class="">个人信息收集清单</view>
				<van-icon name="arrow" color="#8A8F99" />
			</view>
			<view class="fx-center-between setup-item" @click="toArtical('share_info_list')">
				<view class="">与第三方共享个人信息清单</view>
				<van-icon name="arrow" color="#8A8F99" />
			</view> -->
		</view>
		<!-- <view class="fx-center-between setup-item setup-box">
			<view class="">清理缓存</view>
			<view class="fx-center">
				<view class="desc-text">12.2M</view>
				<van-icon name="arrow" color="#8A8F99" />
			</view>
		</view> -->
		<view class="setup-box setup-btn" @click="logout">
			退出登录
		</view>
		<c-center-dialog ref="tipRef" cancelText="返回" comfirmText="退出" @comfirm="comfirm">
			<template>
				<view style="font-size: 30rpx;">
					是否确认退出登录？退出后下次进入需要从新登录
				</view>
			</template>
		</c-center-dialog>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods: {
			// 账户与安全
			toAccount() {
				uni.navigateTo({
					url: '/pages/mine/setup/account/account'
				})
			},
			toArtical(slug) {
				uni.navigateTo({
					url: '/pages/artical/artical?slug=' + slug
				})
			},
			// 退出登录
			logout() {
				this.$refs.tipRef.show()
			},
			comfirm() {
				uni.clearStorage()
				uni.clearStorageSync()
				this.$refs.tipRef.close()
				this.$store.commit('loginChange', false);
				setTimeout(() => {
					uni.switchTab({
						url: '/pages/index/index'
					})
				}, 500)
			}
		}
	}
</script>

<style lang="scss">
	.setup-box {
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		background: #FFFFFF;
		margin-top: 16rpx;
	}

	.setup-item {
		padding: 34rpx 32rpx;
		font-size: 30rpx;
		color: #161616;

		.desc-text {
			color: #8A8F99;
			margin-right: 10rpx;
		}
	}

	.setup-btn {
		color: #FF3B51;
		text-align: center;
		padding: 34rpx 0;
	}
</style>